home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Resident 2
/
Resident - Issue 2 (19xx)(Angelica - SHI).adf
/
Data
/
038
< prev
next >
Wrap
Text File
|
1993-04-19
|
8KB
|
231 lines
¶3 MOTOROLA 68000 - If the cap fits...
¶2 By Dr Alan Clements
Typed and edited by Dotten
(God be in mercy of my soul)
(Automatic spell-checker: Cray)
¶1 Since the PC has become a de facto
standard, why should anyone worry
about other types of computer? Well,
I do, because I teach courses in
computer architecture. My courses are
generally base on the 68000 family and
each year at least one student asks
why I am not teaching the architecture
of the 80386. The short answer I give
is 'Just because you can't see
something doesn't mean that it doesn't
exist. The long answer is provided by
this article.
My job is to TEACH students, not to
train them. When I teach computer
architecture I present the underlying
principles and expect my students to
use these principles to syntesize new
knowledge long after they graduated.
For example, in ten years one of my
students might have to make a decision
about which microprocessor (mp) to
embed into an aircraft flight control
system. He or she should be able to
apply the basic principles I teach in
my courses. Training, by contrast, is
more concerned with teaching directly
applicable knowledge that enables the
student to perform a specific task: a
course on how to use Word Perfect
would be considered as training. If I
were training my students to be PC
salespeople or engineers, I would
certanly use the 8086 family.
I select the ¶368000 ¶1as a vehicle to
teach computer architecture because it
is much better suited to this task
than members of the Intel family.
Choosing the Motorola family rather
than the Intel family is not a
criticism of Intel's chips. (The jerk
uses a PC. Dotten's anm.) Intel was
responisble for the mp as we know it
and wisely (from a business point of
view) capitalized on its lead.
Although it's a simplification, each
new Intel chip is built on the
foundation of it's predecessor.
Intel's first 16-bit chip, the 8086,
was essensially an extension of the
8-bit 8088. This approach makes good
economic sense because programmers can
run their existing software on each
new generation of Intel chips with
relatively little modification.
¶2 Intel's competitor, Motorola, took a
different approach to chip design.
When it made the jump from an 8-bit
processor (the 6800) to a 16-bit
processor (the 68000), it went back to
the drawing board. Unlike Intel, it's
new processor was in no way compatible
with its old one and 8-bit users had
to start again. However by going back
to the drawing board, Motorola was
able to produce a true 32-bit
processor with consistent features.
(Note that the ¶368000 ¶2was originally
called a 16-bit processor because it
communicates via a 16-bit data bus.
As far as the programmer is concerned
the 68000 has a 32-bit architecture
because it registers are 32 bits
wide.) (Like the 80386SX Dotten's
anm.)
¶1 Before we look at what the ¶368000
¶1family has to offer the teacher, we
need to point out that it is not an
obscure teaching tool relegated only
to the classroom. The ¶368000 ¶1family is
used in far more applications than the
8086 family. But most of the ¶368000¶1's
applications are invisible because
they are largely used in industry or
in dedicated applications (such as the
laser printer). As I have said, just
beacuse you cannot see these
applications it does not mean they
don't exist.
Simplicity
¶2 Let's return to my job as a teacher.
In a first year course I have to teach
the basic principles of the CPU. What
I need is a simple architecture -
there's no point in obscuring the
fundamental principles with a mass of
detail. The ¶368000 ¶2embodies
simplicity. When mp's were first
introduced, each new chip had more
instructions and adressing modes than
it's predecessors. Salespeople loved
to emphasize this point:"Buy my chip
because it's got more instructions
than brand X". It's rather like
saying "learn German instead of French
because it's nouns have three genders
rather than two".
¶1 When the ¶368000 ¶1was first designed,
it's instruction set was actually
simpler than that of many 8-bit mp's
even though it was vastly more
powerful. This simplicity was
achieved in two ways. Firstly unlike
the 8086 the ¶368000 ¶1does not have
dedicated registers. The 68000 has
eight data registers, D0 to D7, and
whatever you can do to Di you can do
to Dj. So, if I tell my students that
ADD xyz,D2 is a legal instruction that
adds the contents of xyz to register
D2, they immediatly know that they can
use SUB xyz,D6 to subtract xyz from
D6. Why? Because specific registers
are not dedicated to specific
instructions and whatever you can do
with D2 you can do with D6. Secondly,
the ¶368000 ¶1has simplified its
instruction set by giving one name to
all the members of the class of
instructions that transfer data from
on place to another. Prior to the
68000, the programmer had to learn
instructions like:
LDA Load accumulator with data from
memory. STA Store acc in memory. LDX
Load index register with data from
memory. STX Store index in memory.
(which reminds me of the fun'n'games
we had with the 6502 Dotten's anm.)
[Fun?? I must say I prefer the 68000.
Cray's anm.]
and so on. The ¶368000 ¶1has a simple
MOVE instruction that transfers data
from anywhere to anywhere. MOVE D0,D2
copies register D0 to D2. MOVE A4,xyz
copies the contents of A4 into memory
location xyz. MOVE abc,def copies the
contents of memory loaction abc into
location def. What could be simpler?
(Basic???? Dotten's anm.) [No! In
basic you would have to use "Poke
def,Peek(abc)" Cray's anm.] Having a
powerful but simple instruction set
means I can do what I'm paid to do and
not waste time teaching an instruction
set that is as tedoius as the thirteen
times table. (????? Dotten's anm.)
[Are you stupid? It means 13x0, 13x1,
13x2 etc. Cray's anm.]
¶2 As the course progresses we
introduce more advanced topics such as
position independent code. A program
may not always be located within the
same region of memory. Suppose you
write a device driver to control a
video display. If this program
accesses specific memory loactions it
must always be stored in the same
place in every system using it. This
restriction can sometimes be
inconvenient, as another program might
already occupy the same region of
memory space. The ¶368000 ¶2allows you to
write programs in such a fashion that
the resulting binary code can be
located anywhere in memory without
having to be rewritten.
¶1 The trick is to avoid explicit (i.e.
actual) memory addresses. For
example, the ¶368000 ¶1instruction ADD
xyz(PC),D2 tells the processor to add
the contents of the memory location
that is xyz bytes from the current
instruction to register D2. It
doesn't matter where you put this
instruction in memory, because the
data is always loacted xyz bytes away.
The notation xyz(PC) is called
relative addressing because the
loaction of the data is expressed with
respect to the program counter.
¶2 Students studying computer science
also take courses in high level
languages and in the design and
construction of compilers for these
languages. Two of the most important
aspects of high level languages are
the way of which parameters are passed
between a subroutine and the program
that calls it, and recursion (the
ability of a subroutine to call it-
self). The ¶368000 ¶2implements, at the
machine code level, powerful
mechanisms that performs both these
operations efficiently. For example
the ¶368000 ¶2has a special instruction
called LINK that enables a subroutine
to grab a bit of memory for its own
private use. Even if an interrupt
occurs and other software calls the